import request from '@/utils/request'

export default {
  // 5.2.6．用户名+密码登录
  login: ({ username, password }) => {
    return request({
      url: `usr/api/v1/user/login`,
      method: 'post',
      data: { account: username, password: window.btoa(password) }
    })
      .then(res => {
        return res
      })
  },
  // 5.2.7．用户退出   vuex setInfo中重置对应的值
  logout() {
    return request({
      url: `usr/api/v1/user/logout`,
      method: 'post'
    })
  }
}
